#include <stdio.h>
#include <string.h>
int main()
{
    char n[7],number[10][7]=

{"zero","one","two","three","four","five","six","seven","eight","nine"};
    int a=0,b=0,t=0;
    while (scanf("%s",&n)!=EOF)
    {
        if (n[0]=='+')t=1;
        else if (n[0]=='=')
        {
            t=0;
            if (a==0 && b==0)break;
            printf("%d\n",a+b);
            a=b=0;
        }
        else
        {
            if (t==0)
            {
                int i;
                for (i=0;i<10;i++)
                    if(strcmp(number[i],n)==0)break;
                a=a*10+i;
            }
            if (t==1)
            {
                int i;
                for (i=0;i<10;i++)
                    if(strcmp(number[i],n)==0)break;
                b=b*10+i;
            }
        }
    }
    return 0;
}
